﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Produtos.master" AutoEventWireup="true" CodeBehind="ProdutosSubFamilia.aspx.cs" Inherits="MakeIT.Deo.Apresentacao.ProdutosSubFamilia"%>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cphTit" runat="server">
    <asp:Label ID="LabelSubFamilia" runat="server" Text="Label" Font-Size="Large" ForeColor="Blue" Font-Names="Arial Black"></asp:Label>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="cphPrd" runat="server">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
   
    <asp:Repeater ID="RepeaterSubFamilia" runat="server" OnItemDataBound="RepeaterSubFamilia_OnItemDataBound">
        <HeaderTemplate>
            <table border="1" cellpadding="0" cellspacing="0" width="100%">
        </HeaderTemplate>
        
        <ItemTemplate>
            <tr>
                <td style="max-width:200px;">
                    <b><%# DataBinder.Eval(Container.DataItem,"subFamilia").ToString() %></b><br />
                    <asp:ImageButton ID="imgbFotoProduto" runat="server" width="150" style="max-height:200px;" ImageUrl=<%#"~/DownSubFamilia.aspx?idSubFamilia="+Eval("idSubFamilia")+"&type=small" %> 
                    ToolTip="Clique aqui para ver a foto do produto" OnClick="ButtonFotoSubFamilia_Click" CommandArgument='<%#Eval("idSubFamilia")%>'/>
                </td>
                <td>
                    <asp:GridView ID="GridViewItens" runat="server" AutoGenerateColumns="False" 
                        CellPadding="2" ForeColor="#333333" 
                        GridLines="None" CellSpacing="2" Enabled="true" Width="100%">
                        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" Font-Size="8pt"/>
                        <Columns>
                            <asp:BoundField DataField="Referencia" HeaderText="Ref" />
                            <asp:BoundField DataField="Produto" HeaderText="Descri&ccedil;&atilde;o" ItemStyle-HorizontalAlign="Left"/>
                            <asp:BoundField DataField="Cor" HeaderText="Cor" />
                            <asp:BoundField DataField="Medida" HeaderText="Med. (mm)" />
                            <asp:BoundField DataField="Embalagem" HeaderText="EMB" />
                            <asp:BoundField DataField="Caixa" HeaderText="CX" />
                            <asp:BoundField DataField="Unidade" HeaderText="UN" />
                            <asp:BoundField DataField="IPI" HeaderText="IPI" />
                            <asp:TemplateField>
                                <ItemTemplate>
                                    <asp:ImageButton ID="imgbAddToCart" runat="server" Width="32" Height="32"
                                    ImageUrl="~/App_Themes/Padrao/imagens/masterPage/shopping_cart_up.png" 
                                    ToolTip="Adiciona este produto ao carrinho de orçamento" OnClick="ButtonAddToCart_Click" CommandArgument='<%#Eval("IdProduto")%>'/>
                                </ItemTemplate>
                                <HeaderTemplate>Adicionar ao carrinho</HeaderTemplate>
                            </asp:TemplateField>
                             <asp:TemplateField>
                                <ItemTemplate>
                                    <%# (Eval("Fotog")==null && Eval("Fotop")==null ?"<div style=\"display:none;\">":"") %>
                                        <asp:ImageButton ID="imgbFoto" runat="server" Width="36" Height="36"
                                        ImageUrl="~/App_Themes/Padrao/imagens/masterPage/Camera.png" 
                                        ToolTip="Clique aqui para ver a foto do produto" OnClick="ButtonFoto_Click" CommandArgument='<%#Eval("IdProduto")%>'/>
                                    <%# (Eval("Fotog") == null && Eval("Fotop") == null ? "</div>" : "")%>
                                </ItemTemplate>
                                <HeaderTemplate>Foto</HeaderTemplate>
                            </asp:TemplateField>
                       </Columns>
                        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" Font-Size="Small"/>
                        <EditRowStyle BackColor="#999999" />
                        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                    </asp:GridView>
                     
                </td>
            </tr>
        </ItemTemplate>
        
        <SeparatorTemplate>
        </SeparatorTemplate>
        
        <FooterTemplate>
            </table>
        </FooterTemplate>
    </asp:Repeater>

        <asp:Panel ID="PanelFoto" runat="server" Visible="false">

            <div style="position:fixed;  top:0; left:0; background-color:Gray; filter: alpha(opacity=50); opacity:.5; width:100%; height:100%;vertical-align:middle; text-align:center;">
            </div>
            <div style="position:fixed;  top:0; left:0; width:100%; height:100%; font-size:medium; font-weight:bold; overflow:auto;">
            <table style="width:100%; height:100%;">
                <tr>
                    <td style="text-align:center; vertical-align:middle;">
                    <center>

                <asp:Table ID="Table1" runat="server" cellpadding="0" cellspacing="0">
                    <asp:TableRow>
                    <asp:TableCell HorizontalAlign="Right">
                        <asp:ImageButton ID="ImageButton1" runat="server"  ImageUrl="~/App_Themes/Padrao/imagens/masterPage/fechar.png"
                               OnClick="ButtonFotoClose_Click"/>
                    </asp:TableCell>
                    </asp:TableRow>
                    <asp:TableRow id="tbrow" runat="server">
                        <asp:TableCell id="tbcell" runat="server" BackColor="#707070" style="vertical-align:middle; text-align:center; padding:1px 6px 1px 6px;" ><center>
                            <asp:Image ID="Image2" runat="server" style="min-width:400px; max-width:800px; min-height:250px; max-height:500px;" /><br />
                            <asp:Label ID="Label2" runat="server" Text="" style="color:White;"></asp:Label>
                        </asp:TableCell>
                    </asp:TableRow>
                </asp:Table>
                <asp:RoundedCornersExtender ID="RoundedCornersExtender2" runat="server" TargetControlID="tbcell" Radius="8">
                </asp:RoundedCornersExtender>

                    </center>
                    </td>
                </tr>
            </table>
            </div>
        </asp:Panel>


    </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content> 
